package com.woniuxy.springboot.mybatis.service.impl;

import com.woniuxy.springboot.mybatis.mapper.UserMapper;
import com.woniuxy.springboot.mybatis.pojo.User;
import com.woniuxy.springboot.mybatis.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Service
@Transactional
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;

    @Override
    public List<User> selectAllUsers() {
        return userMapper.selectAllUsers();
//        userMapper.selectAllUsers();
//        return null;
    }

    @Override
    public User selectUserByUid(Integer uid) {
        return userMapper.selectUserByUid(uid);
    }

    @Override
    public List<User> selectUserByUids(List<Integer> ids) {
        return userMapper.selectUserByUids(ids);
    }

    @Override
    public int insertUser(User user) {
        int res = userMapper.insertUser(user);
        return res;
    }
}
